﻿using Ndns.ServerHost.Abstractions;
using System.Collections.Generic;

namespace Ndns.ServerHost
{
    class MiddlewaresBuilder : IMiddlewaresBuilder
    {
        private readonly IList<IMiddleware> _middlewares;

        public MiddlewaresBuilder(IList<IMiddleware> middlewares)
        {
            _middlewares = middlewares;
        }

        public IMiddlewaresBuilder Use(IMiddleware middleware)
        {
            _middlewares.Add(middleware);
            return this;
        }
    }
}
